﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Migrator.Framework;
using System.Data;

namespace Jobping.ShortUrls.Database
{
    [Migration(1)]
    public class Url_Create : Migration
    {
        public override void Up()
        {
            Database.AddTable("Url",
                new Column("Id", DbType.Int64, ColumnProperty.PrimaryKeyWithIdentity),
                 new Column("ShortUrl", DbType.String, 50, ColumnProperty.Unique),
                new Column("LongUrl", DbType.String, 2048, ColumnProperty.Indexed),
                new Column("DateCreated", DbType.Date, ColumnProperty.NotNull)
                );
        }

        public override void Down()
        {
            Database.RemoveTable("ShortUrls.Url");
        }

    }
}
